package com.xm.web.controller.system;

import com.xm.common.entity.R;
import com.xm.web.service.ITbPermissionService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.RequiredArgsConstructor;
import org.springframework.cache.annotation.Cacheable;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * 权限
 *
 * @author yousj
 * @since 2021/8/26
 */
@RestController
@RequiredArgsConstructor
@RequestMapping("/sys/permission")
@Api(tags = "权限")
public class PermissionController {

    private final ITbPermissionService permissionService;

    @ApiOperation(value = "列表")
    @GetMapping("/list")
    @Cacheable(value = "permissionAllCache", key = "'permissionAllCache#1800#'")
    public R list() {
        return R.isOk(permissionService.all());
    }

}
